<!DOCTYPE html>
<html lang="en">
    <head>
	    <meta charset="utf-8">
	    <title>后台管理系统</title>
	    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
	    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	    <meta name="description" content="">
	    <meta name="author" content="">
	    {load href="/static/css/bootstrap.css" /}
	    {load href="/static/css/theme.css" /}
	    {load href="/static/css/font-awesome.css" /}
	    {load href="/static/js/jquery-1.7.2.min.js" /}
	    <!-- Demo page code -->
	    <style type="text/css">
	        #line-chart {
	            height:300px;
	            width:800px;
	            margin: 0px auto;
	            margin-top: 1em;
	        }
	        .brand { font-family: georgia, serif; }
	        .brand .first {
	            color: #ccc;
	            font-style: italic;
	        }
	        .brand .second {
	            color: #fff;
	            font-weight: bold;
	        }
	        .pagination li{
            	float:left;
           		list-style: none;
            	margin-left:5px;
        	}
        	.pagination li a{
	    		color:red;
	    		text-decoration: none
       		}
        	.pagination li.active{
            	color:blue;
        	}
        	.pager li{
           		float:left;
           		list-style: none;
       		}
        	ul[class=pagination]{
            	margin-left:440px;
        	}

      
			body {
				margin:0;
				padding:0;
				font:12px/15px "Helvetica Neue",Arial, Helvetica, sans-serif;
				color: #555;
				background:#f5f5f5 url('/static/img/bg.jpg');
			}
			
			a {color:#666;}
			
			/*#content {width:65%; max-width:690px; margin:6% auto 0;}*/
			
			/*
			Pretty Table Styling
			CSS Tricks also has a nice writeup: http://css-tricks.com/feature-table-design/
			*/
			
			table {
				overflow:hidden;
				border:1px solid #d3d3d3;
				background:#fefefe;
				/*width:80%;*/
				margin:5% auto 0;
				-moz-border-radius:5px; /* FF1+ */
				-webkit-border-radius:5px; /* Saf3-4 */
				border-radius:5px;
				-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
				-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
			}
			
			th, td {padding:5px 5px; text-align:center; }
			
			th {padding-top:22px; text-shadow: 1px 1px 1px #fff; background:#e8eaeb;}
			
			td {border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;}
			
			tr.odd-row td {background:#f6f6f6;}
			
			td.first, th.first {text-align:left}
			
			td.last {border-right:none;}
			
			/*
			Background gradients are completely unnecessary but a neat effect.
			*/
			
			td {
				background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);
				background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));
			}
			
			tr.odd-row td {
				background: -moz-linear-gradient(100% 25% 90deg, #f6f6f6, #f1f1f1);
				background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f1f1f1), to(#f6f6f6));
			}
			
			th {
				background: -moz-linear-gradient(100% 20% 90deg, #e8eaeb, #ededed);
				background: -webkit-gradient(linear, 0% 0%, 0% 20%, from(#ededed), to(#e8eaeb));
			}
			
			/*
			I know this is annoying, but we need additional styling so webkit will recognize rounded corners on background elements.
			Nice write up of this issue: http://www.onenaught.com/posts/266/css-inner-elements-breaking-border-radius
			
			And, since we've applied the background colors to td/th element because of IE, Gecko browsers also need it.
			*/
			
			tr:first-child th.first {
				-moz-border-radius-topleft:5px;
				-webkit-border-top-left-radius:5px; /* Saf3-4 */
			}
			
			tr:first-child th.last {
				-moz-border-radius-topright:5px;
				-webkit-border-top-right-radius:5px; /* Saf3-4 */
			}
			
			tr:last-child td.first {
				-moz-border-radius-bottomleft:5px;
				-webkit-border-bottom-left-radius:5px; /* Saf3-4 */
			}
			
			tr:last-child td.last {
				-moz-border-radius-bottomright:5px;
				-webkit-border-bottom-right-radius:5px; /* Saf3-4 */
			}

	    </style>
	    <link rel="shortcut icon" href="../assets/ico/favicon.ico">
	    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
	    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
	    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
	    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
  </head>
  <body class="">  
  	{include file="public:header"}
  	{include file="public:left"}
    <div class="content">  
        <div class="header">
            <div class="stats">
    			<p class="stat"><span class="number" id="date"></span>日</p>
   	 			<p class="stat"><span class="number" id="month"></span>月</p>
    			<p class="stat"><span class="number" id="year"></span>年</p>
			</div>
        	<h1 class="page-title">商品管理</h1>
        </div>
       	<ul class="breadcrumb">
            <li><a href="index.html">Admin</a> <span class="divider">/</span></li>
            <li class="active">product_list</li>
        </ul>
    	<div class="container-fluid">
        	<div class="row-fluid">
				<div style="float:right; margin-top: 1em;">
	    			<a href='{:url("admin/product/product_list")}' class="btn btn-danger">商品列表</a>				    
	    			<a href='{:url("admin/product/add_product")}' class="btn btn-success">添加商品</a>
	    			<a href='{:url("admin/product/pro_cates")}' class="btn btn-primary">分类列表</a>
	    			<a href='{:url("admin/product/add_pro_cates")}' class="btn btn-warning">添加分类</a>			    
				</div>
				<h3>&nbsp;&nbsp;&nbsp;商&nbsp;品&nbsp;列&nbsp;表</h3>
				<div id='calendar'>
					<table cellspacing="0px" border="1px" align="center">
						<th width="55px">序号</th>
						<th height="" width="90px">商品名称</th>
						<th width="120px">图片</th>
						<th width="55px">价格</th>
						<th width="55px">原价</th>
						<th width="55px">销量</th>
						<th width="55px">库存</th>
						<th width="65px">描述</th>
						<th width="">团购</th>
						<th width="55px">状态</th>
						<th width="55px">删除</th>
						<th width="55px">编辑</th>
						{foreach $data as $v}
								<tr align="center" height="30px">
									<td>{$list++}</td>
									<td>{$v['pname']}</td>
									<td><img src="{$v['pimgs'][0]}" width="135px"></td>
									<td>￥{$v['price']}</td>
									<td>￥{$v['old_price']}</td>
									<td>{$v['sales']}</td>
									<td>剩余:{$v['pnum']}</td>
									<td>{$v['descrip']}</td>
									<td align="left">
										活动时间:<br>
										&nbsp;{$v['mktime']}<br>
										&nbsp;&nbsp;—<br>
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$v['die_time']}
									</td>
									{if condition="$v['ifshow']==1"}
										<td>
											<a href='{:url("admin/product/product_ifshow",["ifshow"=>"1","id"=>$v["id"]])}'>上架</a>
										</td>
									{else/}
										<td><a href='{:url("admin/product/product_ifshow",["ifshow"=>"0","id"=>$v["id"]])}'>下架</a></td>
									{/if}
									<td><a href='{:url("admin/product/del_product",["id"=>$v.id,"page"=>$nowpage])}'>删除</a></td>
									<td><a href='{:url("admin/product/edit_product",["id"=>$v.id])}'>编辑</a></td>
								</tr>			
						{/foreach}
					</table>
					{$page}
				</div>                   
			    {include file="public:footer"}         
            </div>
        </div>
    </div>
    {load href="/static/js/bootstrap.js" /}
    <script type="text/javascript">
        $("[rel=tooltip]").tooltip();
        $(function() {
            $('.demo-cancel-click').click(function(){return false;});
        });
        var d=new Date
        $("#year").html(d.getFullYear())
        $("#month").html(d.getMonth()+1)
        $("#date").html(d.getDate())

        $(function() {
		/* For zebra striping */
        $("table tr:nth-child(odd)").addClass("odd-row");
		/* For cell text alignment */
		$("table td:first-child, table th:first-child").addClass("first");
		/* For removing the last border */
		$("table td:last-child, table th:last-child").addClass("last");
});
    </script>
  </body>
</html>


